package com.xyzwps.server.paimon.model.table

import com.xyzwps.server.paimon.model.entity.Article
import org.jetbrains.exposed.v1.core.dao.id.LongIdTable
import org.jetbrains.exposed.v1.datetime.CurrentTimestamp
import org.jetbrains.exposed.v1.datetime.timestamp

object ArticleTable : LongIdTable("article") {
    val uid = varchar("uid", Article.UID_MAX_LENGTH).uniqueIndex("uk_article_uid")
    val userId = long("user_id")
    val title = varchar("title", Article.TITLE_MAX_LENGTH).index("idx_user_id")
    val content = text("content")
    val createdAt = timestamp("created_at").defaultExpression(CurrentTimestamp)
}